package org.jeecgframework.tag.core.easyui;

import java.io.IOException;
import java.util.List;

import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
 
public class ReplaceTextTag extends TagSupport {
	 
	private List value;
	
	public int doStartTag() throws JspTagException {
		return EVAL_PAGE;
	}
	public int doEndTag() throws JspTagException {
		try {
			JspWriter out = this.pageContext.getOut();
			out.print(end().toString());
			out.flush();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return EVAL_PAGE;
	}
	public StringBuffer end() {
		StringBuffer sb = new StringBuffer();
		 
		if(value == null) return sb;
		
		for(int i=0;i<value.size();i++){
			Object obj = value.get(i);
			sb.append(obj.toString()+"_"+"12");
			if(i != value.size()-1){
				sb.append(",");
			}
		}
		
		System.out.println(sb.toString());
		
		return sb;
	}
	
	
}
